package com.znyj.cloud.device.pack;

import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.atomic.AtomicLong;

/**
 * Created by gaoliwei02 on 17/6/12.
 */
public class AtomicValues {
    private static Map<Long, Integer> deviceReportCnt = new ConcurrentHashMap<>();

    private static AtomicLong orderId = new AtomicLong(0);

    public static long incOrderId() {
        return orderId.incrementAndGet();
    }

    public static long swapOrderId(long newValue) {
        return orderId.getAndSet(newValue);
    }

}
